import Vue from 'vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);
import vueDebugPluginFn from 'vue-debug-plugin';
import { isDevForBoth, isLocal } from './utils/tools'; 

const ctx = require.context('./views', true, /\.vue$/)
  const map = {}
for (const key of ctx.keys()) {
  map[key] = ctx(key)
}
// debugger
console.log(map,ctx.keys())
const vueDebugPlugin = vueDebugPluginFn({
  msgboxWidth: 'auto',
  msgboxHeight: 500,
  ignoreCompsPrefix: ['el'], // 忽略的组件前缀
  ignoreComps: ['tableBody', 'tableHeader', 'vitIcon', 'transition'], // 忽略的组件
  // 是否展示未查询到文件地址的组件，是本地就过滤 是测试环境或线上就打开
  filterDepends: !!isLocal(),
  isDev: isDevForBoth,
  hasElementUI: true // 项目是否接入了elementUi
  // isMapp: true 如果是子应用 需要设置为true  无微应用可以忽略
});
Vue.use(vueDebugPlugin);

import App from './App.vue'
import router from './router'
import store from './store'

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
